<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Kinetis Bootloader Host: blfwk::SimPeripheral Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Kinetis Bootloader Host
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
   <div id="projectbrief">Host Tools for Kinetis devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Introduction</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classblfwk_1_1_sim_peripheral.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classblfwk_1_1_sim_peripheral-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">blfwk::SimPeripheral Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a class="el" href="classblfwk_1_1_peripheral.html" title="Represents a peripheral. ">Peripheral</a> that operates in the simulation space.  
 <a href="classblfwk_1_1_sim_peripheral.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_sim_peripheral_8h_source.html">SimPeripheral.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for blfwk::SimPeripheral:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="classblfwk_1_1_sim_peripheral__inherit__graph.svg" width="151" height="112"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="closed.png" alt="+"/> Collaboration diagram for blfwk::SimPeripheral:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="classblfwk_1_1_sim_peripheral__coll__graph.svg" width="299" height="156"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a335cd1a16ce0a8eaefe6ae633658208d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a335cd1a16ce0a8eaefe6ae633658208d"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblfwk_1_1_sim_peripheral.html#a335cd1a16ce0a8eaefe6ae633658208d">SimPeripheral</a> (uchar_deque_t *inStream, uchar_deque_t *outStream)</td></tr>
<tr class="memdesc:a335cd1a16ce0a8eaefe6ae633658208d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default Constructor. <br /></td></tr>
<tr class="separator:a335cd1a16ce0a8eaefe6ae633658208d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b2d9c51e9aa007f91d22d5d6b8c4ce1"><td class="memItemLeft" align="right" valign="top">virtual status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblfwk_1_1_sim_peripheral.html#a6b2d9c51e9aa007f91d22d5d6b8c4ce1">read</a> (uint8_t *buffer, uint32_t requestedBytes, uint32_t *actualBytes, uint32_t timeoutMs)</td></tr>
<tr class="memdesc:a6b2d9c51e9aa007f91d22d5d6b8c4ce1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read bytes.  <a href="#a6b2d9c51e9aa007f91d22d5d6b8c4ce1">More...</a><br /></td></tr>
<tr class="separator:a6b2d9c51e9aa007f91d22d5d6b8c4ce1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a65e6facc8f4cb0cb27545b58abbf8a7c"><td class="memItemLeft" align="right" valign="top">virtual status_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblfwk_1_1_sim_peripheral.html#a65e6facc8f4cb0cb27545b58abbf8a7c">write</a> (const uint8_t *buffer, uint32_t byteCount)</td></tr>
<tr class="memdesc:a65e6facc8f4cb0cb27545b58abbf8a7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write bytes.  <a href="#a65e6facc8f4cb0cb27545b58abbf8a7c">More...</a><br /></td></tr>
<tr class="separator:a65e6facc8f4cb0cb27545b58abbf8a7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ac54aa15267f867562775a3867007ef8a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac54aa15267f867562775a3867007ef8a"></a>
uchar_deque_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblfwk_1_1_sim_peripheral.html#ac54aa15267f867562775a3867007ef8a">m_inStream</a></td></tr>
<tr class="memdesc:ac54aa15267f867562775a3867007ef8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes go to this stream. <br /></td></tr>
<tr class="separator:ac54aa15267f867562775a3867007ef8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31aff68ebbbe26b4b4b639998b825e06"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a31aff68ebbbe26b4b4b639998b825e06"></a>
uchar_deque_t *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classblfwk_1_1_sim_peripheral.html#a31aff68ebbbe26b4b4b639998b825e06">m_outStream</a></td></tr>
<tr class="memdesc:a31aff68ebbbe26b4b4b639998b825e06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads come from this stream. <br /></td></tr>
<tr class="separator:a31aff68ebbbe26b4b4b639998b825e06"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_types_classblfwk_1_1_peripheral"><td colspan="2" onclick="javascript:toggleInherit('pub_types_classblfwk_1_1_peripheral')"><img src="closed.png" alt="-"/>&#160;Public Types inherited from <a class="el" href="classblfwk_1_1_peripheral.html">blfwk::Peripheral</a></td></tr>
<tr class="memitem:a276e207594e3b7cd9e3efbedd1d022e3 inherit pub_types_classblfwk_1_1_peripheral"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a276e207594e3b7cd9e3efbedd1d022e3"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>_host_peripheral_types</b> { <br />
&#160;&#160;<b>kHostPeripheralType_None</b>, 
<br />
&#160;&#160;<b>kHostPeripheralType_UART</b>, 
<br />
&#160;&#160;<b>kHostPeripheralType_BUSPAL_UART</b>, 
<br />
&#160;&#160;<b>kHostPeripheralType_USB_HID</b>, 
<br />
&#160;&#160;<b>kHostPeripheralType_SIM</b>
<br />
 }</td></tr>
<tr class="separator:a276e207594e3b7cd9e3efbedd1d022e3 inherit pub_types_classblfwk_1_1_peripheral"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classblfwk_1_1_peripheral.html" title="Represents a peripheral. ">Peripheral</a> that operates in the simulation space. </p>
<p>Simulation peripherals are connected together using the streams provided to the init() method. For example, to connect a "host" peripheral to a "device" peripheral, specify the host's output stream as the device's input stream. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a6b2d9c51e9aa007f91d22d5d6b8c4ce1"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">status_t SimPeripheral::read </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>requestedBytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>actualBytes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeoutMs</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Read bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>Pointer to buffer. </td></tr>
    <tr><td class="paramname">requestedBytes</td><td>Number of bytes to read. </td></tr>
    <tr><td class="paramname">actualBytes</td><td>Number of bytes actually read. </td></tr>
    <tr><td class="paramname">timeoutMs</td><td>Time in milliseconds to wait for read to complete. </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classblfwk_1_1_peripheral.html#ab79cfe09f48bb7f4e0394099a9f43f3c">blfwk::Peripheral</a>.</p>

</div>
</div>
<a class="anchor" id="a65e6facc8f4cb0cb27545b58abbf8a7c"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">status_t SimPeripheral::write </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>byteCount</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Write bytes. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">buffer</td><td>Pointer to buffer to write </td></tr>
    <tr><td class="paramname">byteCount</td><td>Number of bytes to write </td></tr>
  </table>
  </dd>
</dl>

<p>Implements <a class="el" href="classblfwk_1_1_peripheral.html#aa969e9612d082ad57dfc6d9d4047e8f3">blfwk::Peripheral</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_sim_peripheral_8h_source.html">SimPeripheral.h</a></li>
<li>SimPeripheral.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>blfwk</b></li><li class="navelem"><a class="el" href="classblfwk_1_1_sim_peripheral.html">SimPeripheral</a></li>
    <li class="footer">Generated on Mon Mar 7 2016 16:49:51 for Kinetis Bootloader Host by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
